#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const int mod = 1e9+7;
const int MAXN = 5e5+10;

int nxt[MAXN],snxt[MAXN],n;
char s[MAXN];

int main (){
	scanf("%s",s+1); n = strlen(s+1);
	nxt[1] = 0;
	for(int i = 2,j = 0;i <= n;i++){
		while(j && s[j+1] != s[i]) j = nxt[j];
		if(s[j+1] == s[i]) j++;
		nxt[i] = j;
	}
	reverse(s+1,s+n+1); snxt[1] = 0;
	for(int i = 2,j = 0;i <= n;i++){
		while(j && s[j+1] != s[i]) j = snxt[j];
		if(s[j+1] == s[i]) j++;
		snxt[i] = j;
	}
	int minl = n - nxt[n];
	if(minl == 1) printf("%d\n%d\n",n,1);
	else if(n % minl || n == minl) printf("1\n1\n");
	else {printf("2\n");int tot = 0;for(int i = 1;i <= n;i++) if((i % (i - nxt[i]) || nxt[i] == 0) && ((n-i) % (n - i - snxt[n-i]) || snxt[n-i] == 0)) tot++;printf("%d\n",tot);}
	return 0;
}

